<?php echo $header; ?>

<div id="content" class="w-content">
    <div class="eachBox undepages contact">
        <h4 class="box_tt">Kontakt os</h4>
        <div class="clearfix">
            <div class="cont-left">
                <?php echo $contact_text; ?>

                <h2><img alt="Havhokeren" src="catalog/view/theme/<?php echo $template; ?>/images/logo-50.png"></h2>
                <p class="contact-info">
                    <?php echo $contact_address ?>
                    Tlf.: <?php echo $contact_telephone ?><br>
                    Fax: <?php echo $contact_fax ?><br>
                    E-mail: <a href="mailto:<?php echo $contact_email; ?>"><?php echo $contact_email; ?></a>
                </p>
            </div>
            <div class="cont-right ">
                <form id="contact" name="contact" action="<?php echo str_replace('&', '&amp;', $action); ?>" method="post">
                    <div class="wrap-form-contact ">
                        <p><i>Felter markeret med * skal udfyldes</i></p>
                        <input type="text" id="name" name="name" class="txtInput required" placeholder="Navn *" />
                        <input type="text" id="email" name="email" class="txtInput required email" placeholder="E-mail *" />
                        <input type="text" id="telephone" name="telephone" class="txtInput required" placeholder="Telefonummer *" />
                        <input type="text" id="subject" name="subject" class="txtInput" placeholder="Emne" />
                        <textarea id="enquiry" name="enquiry" class="txtArea" placeholder="Din besked"></textarea>

                        <a id="contact_submit" class="btn btnSend" href="#">Send</a>
                        <a id="contact_reset" class="btn btnNustil" href="#">Nustil</a>
                    </div>
                </form>
            </div>
        </div>
        <!--clearfix-->
        <div class="wrapMap clearfix">
            <iframe style="border:1px solid #999; z-index: 9999;" width="290" height="199" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Nordre+Havnevej+9,+3250+Gilleleje,+Denmark&amp;aq=0&amp;sll=56.125682,12.307484&amp;sspn=0.009066,0.01929&amp;g=Ndr.+Havnevej+9,+3250+Gilleleje,+Denmark&amp;ie=UTF8&amp;hq=&amp;hnear=Nordre+Havnevej+9,+3250+Gilleleje,+Denmark&amp;ll=56.125677,12.307477&amp;spn=0.009066,0.01929&amp;z=14&amp;output=embed"></iframe><br />
            <small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=Nordre+Havnevej+9,+3250+Gilleleje,+Denmark&amp;aq=0&amp;sll=56.125682,12.307484&amp;sspn=0.009066,0.01929&amp;g=Ndr.+Havnevej+9,+3250+Gilleleje,+Denmark&amp;ie=UTF8&amp;hq=&amp;hnear=Nordre+Havnevej+9,+3250+Gilleleje,+Denmark&amp;ll=56.125677,12.307477&amp;spn=0.009066,0.01929&amp;z=14" style="color:#0000FF;text-align:left"></a></small>
        </div>
    </div>
    <!--eachBox undepages contact-->

    <?php echo $services ?>

    <?php echo $newsletter ?>
        
<script language="javascript"><!-- 
	// Validate form
	//var mail_filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
	var mail_filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z]{2,6})+$/;
	var numeric_filter = /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)|(^-?\d*$)/;
	var error = true;
	
	function checkRequired(element){  
		error = jQuery(element).val() == ''; 
		if(!error){
			if(jQuery(element).hasClass('email')){
				error = !mail_filter.test(jQuery(element).val());
			}
			
			if(jQuery(element).hasClass('telephone')){
				error = (jQuery(element).val().length < 6) || !numeric_filter.test(jQuery(element).val());	
			}
			
			if(jQuery(this).hasClass('postcode')){
				error = (jQuery(element).val().length != 4) || !numeric_filter.test(jQuery(element).val());
			}
		}
		
		if(error){
			if(!jQuery(element).hasClass('errorField')){
				jQuery(element).addClass('errorField');
			}			
			
			//jQuery('#contact_error').html('<h3>Error</h3>');
			//jQuery('#contact_error').show();	
		}
		else{
			if(jQuery(element).hasClass('errorField')){
				jQuery(element).removeClass('errorField');
			}	
			
			//jQuery('#contact_error').hide();		
		}
	}

    /*
	jQuery('#contact input.required').blur(function(){
		checkRequired(this);
	});    	
	*/

	jQuery('#contact_reset').click(function(e){
        e.preventDefault();

		jQuery('#contact input.required').each(function(){
			if(jQuery(this).hasClass('errorField')){
				jQuery(this).removeClass('errorField');
			}			
		});
		//jQuery('#contact_error').hide();	
	});

    jQuery('#contact_submit').click(function(e){
        e.preventDefault();

        jQuery('#contact').submit();
    });

	jQuery('#contact').submit(function(even){
		jQuery('#contact input.required').each(function(){
			checkRequired(this);
		}); 		
		
		return !error;
	});
//-->
</script>

<?php echo $footer;?>